home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 235 / Issue 235 - September 2007 - DPCS0907DVD.ISO / Extras / NetObjects Fusion / NOF10.exe / data1.cab / FSI / lib / nof / dataobjects / tables / ecomm / OptionsTable.js < prev    next >
Encoding:
Text File  |  2007-04-11  |  2.1 KB  |  51 lines

  1. function NOF_DataObjects_OptionsTable(){
  2.   this.__proto__       = NOF_DataObjects_OptionsTable.prototype;
  3.  
  4.   this.SUPER( NOF_TableTypes.NODELESS | NOF_TableTypes.ECOMM_CATALOG, "Options", "Id");
  5.   this.__constructor__ =    NOF_DataObjects_OptionsTable; 
  6. }
  7.  
  8. NOF_DataObjects_OptionsTable.inherits( NOF.DO.Table ); function NOF_DataObjects_OptionsTable_ProtoBuilder(){  
  9.   var member = NOF_DataObjects_OptionsTable.prototype;
  10.   var method = NOF_DataObjects_OptionsTable.prototype;
  11.     
  12.   var NOF_DataObjects_OptionsTable_DDL = new Array(
  13.     new NOF.DO.FieldInfo("Id", NOF.DO.FieldType.INTEGER, 0),
  14.     new NOF.DO.FieldInfo("AttributesGroupId", NOF.DO.FieldType.INTEGER, 1),
  15.     new NOF.DO.FieldInfo("Value", NOF.DO.FieldType.VARCHAR, 2),
  16.     new NOF.DO.FieldInfo("Position", NOF.DO.FieldType.INTEGER, 3)    
  17.   );
  18.     
  19.   member.COL_ID                = 0;
  20.   member.COL_ATTRIBUTESGROUPID = 1;
  21.   member.COL_VALUE             = 2;  
  22.   member.COL_POSITION          = 3;
  23.     
  24.   method.getDDL = function getDDL(){
  25.     return NOF_DataObjects_OptionsTable_DDL;
  26.   }; 
  27.   
  28.   method.selectByAttributesGroupId = function selectByAttributesGroupId( id ){
  29.     return this.selectByFields( [new NOF.DO.FieldValue ("AttributesGroupId", id)]);    
  30.   }
  31.   
  32.   method.selectByAttributesGroupIdValue = function selectByAttributesGroupIdValue( agId, value ){
  33.     return this.selectByFields([new NOF.DO.FieldValue("AttributesGroupId", agId),
  34.                                 new NOF.DO.FieldValue ("Value", value)]);    
  35.   }
  36.   
  37.   method.deleteByAttributesGroupId = function deleteByAttributesGroupId( id ){
  38.     return this.deleteByFields( [new NOF.DO.FieldValue ("AttributesGroupId", id)]);    
  39.   }
  40.   
  41.   method.deleteByAttributesGroupIdValue = function deleteByAttributesGroupIdValue( agId, value ){
  42.     return this.deleteByFields([new NOF.DO.FieldValue("AttributesGroupId", agId),
  43.                                 new NOF.DO.FieldValue ("Value", value)]);    
  44.   }
  45.   
  46.   method.updateById = function updateById( id, fields ){
  47.     return this.updateByFields( [new NOF.DO.FieldValue ("Id", id)], fields);
  48.   }
  49. }
  50.  
  51. NOF_DataObjects_OptionsTable_ProtoBuilder();